home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
BARNET
/
FREENET
/
BLOCH
/
SOCKE14S
/
c
/
debug
< prev
next >
Wrap
Text File
|
1998-09-29
|
733b
|
39 lines
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include "debug.h"
extern struct debug_flags_struct debug_flags={0};
extern FILE *debug_fh = NULL;
static char buf[256];
static char temp_time_buffer[64];
extern char *debug_time(char *format)
{
time_t t;
struct tm *current;
t = time(NULL);
current = localtime(&t);
strftime(temp_time_buffer, 64, format, current);
return(temp_time_buffer);
}
int debug_init(void)
{
return( (int) (debug_fh = fopen("<Choices$Dir>.Socketeer.Debug", "w")) );
}
void debug_log(char *str, ...)
{
va_list x;
if (debug_fh == NULL) return;
va_start(x, str);
vsprintf(buf, str, x);
fprintf(debug_fh, "%s %s\n", debug_time("%H:%M:%S"), buf);
}